<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<script src="js/rem.js"></script>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="css/reset.css"/>
		<link rel="stylesheet" href="css/common.css" />
	</head>
	<body>
		<header>足球圈子-登录</header>
		<div class="form">
			<input type="text" name="" id="logTell" placeholder="手机号"/>
			<input type="password" name="" id="logPass" placeholder="密码"/>
			<div class="links">
				<a class="reg" href="reg.html">注册</a>
				<a class="pwd" href="javascript:;">忘记密码</a>
				<div class="clb"></div>
			</div>
			<button id="logBtn">
				提 交
			</button>
		</div>
	</body>
	<script type="text/javascript" src="js/jquery-1.11.0.js"></script>
	<script type="text/javascript">
		$(function(){
			$("#logBtn").click(function(){
				var logTell = $("#logTell").val(),
				    logPass = $("#logPass").val();
				$.ajax({
					type:"get",
					url:"http://localhost:8080/Proxy/FootBall/user/json/login.do",
					data:{
						"loginname":logTell,
						"password":logPass
					},
					async:true,
					success:function(rsp){
						console.log(rsp);
						var rsp = JSON.parse(rsp);
						if(logTell == rsp.data.loginuser.loginname && logPass == rsp.data.loginuser.password){
							alert("登录成功");
							localStorage.setItem("id",rsp.data.loginuser.id);
							setTimeout(function(){
                                window.location.href = "index.html";
                            },1000);
							
						}else{
							alert(rsp.errorinfo);
						}
					}
				});
			});
			
		})
	</script>
</html>
